home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 2
/
Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso
/
Pearls
/
arc
/
XFH
/
src
/
Lib
/
b2cinplace.c
next >
Wrap
C/C++ Source or Header
|
1992-02-05
|
574b
|
33 lines
/* b2cinplace - in-place conversion between c and bcpl-strings. */
#include <exec/types.h>
#include <libraries/dos.h>
#include <string.h>
char *bstr2cinplace(UBYTE *pp){
register UBYTE len;
register UBYTE *p = pp;
for( len=*p; len--; p++ ) p[0] = p[1];
*p = '\0';
return (char *)pp;
}
BSTR cstr2binplace(char *pp){
register UBYTE len;
register char c,d;
register char *p = pp;
len = strlen(p);
for( c=len; len--; p++ ){
d=*p;
*p=c;
c=d;
}
*p=c;
return (BSTR)((ULONG)pp >> 2);
}
/* End of b2cinplace.c */